package seven.test_7_17;

import java.util.*;


public class Solution {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     *
     * @param numbers int整型一维数组 
     * @return bool布尔型
     */
    public boolean IsContinuous (int[] numbers) {
        // write code here
        int[] arr = new int[14];
        for (int i = 0; i < numbers.length; i++) {
            int tmp = numbers[i];
            if(tmp == 0) {
                arr[tmp]++;
            } else if(arr[tmp] == 0) {
                arr[tmp]++;
            }
        }
        int count = arr[0];
        int h = 0;
        int cur = 0;
        for (int i = 1; i < 14; i++) {
            h += arr[i];
            if(i - cur == 4) {
                if(h + count >= 5 && h > 0) {
                    return true;
                }
                cur++;
                h -= arr[cur];
            }
        }
        return false;
    }
}